package com.linkhub.oms.admin.modules.user.bankstatement.domain.vo;

import com.linkhub.oms.common.util.QtBigDecimalUtil;
import com.linkhub.oms.entity.UserBankStatementEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * <p>
 * 用户银行流水VO
 * </p>
 *
 * @author Frank
 * @since 2024-05-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "UserBankStatementVO", description = "用户银行流水VO")
@NoArgsConstructor
public class UserBankStatementVO implements Serializable {

    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "用户id")
    private String merchantUserId;

    @ApiModelProperty(value = "用户名称")
    private String merchantUserName;

    @ApiModelProperty(value = "用户邮箱")
    private String merchantUserEmail;

    @ApiModelProperty(value = "用户银行卡号")
    private String userCardNumber;

    @ApiModelProperty(value = "公司银行卡号")
    private String companyCardNumber;

    @ApiModelProperty(value = "到账币种")
    private String receivedCurrencyType;

    @ApiModelProperty(value = "到账金额")
    private String receivedAmount;

    @ApiModelProperty(value = "到账时间")
    private LocalDate receivedDate;

    @ApiModelProperty(value = "到账银行流水号_财务审核")
    private String receivedBankStatement;

    @ApiModelProperty(value = "交易id（t_user_recharge_record.Ftransaction_id）")
    private String transactionId;

    @ApiModelProperty(value = "数据状态：0-未匹配；1-已匹配")
    private Integer matchStatus;

    public UserBankStatementVO(UserBankStatementEntity bankStatementEntity) {
        this.id = bankStatementEntity.getId();
        this.merchantUserId = bankStatementEntity.getUserId();
        this.userCardNumber = bankStatementEntity.getUserCardNumber();
        this.companyCardNumber = bankStatementEntity.getCompanyCardNumber();
        this.receivedCurrencyType = bankStatementEntity.getReceivedCurrencyType();
        this.receivedAmount = QtBigDecimalUtil.toString(bankStatementEntity.getReceivedAmount());
        this.receivedDate = bankStatementEntity.getReceivedDate();
        this.receivedBankStatement = bankStatementEntity.getReceivedBankStatement();
        this.transactionId = bankStatementEntity.getTransactionId();
        this.matchStatus = bankStatementEntity.getMatchStatus().getCode();
    }

}
